home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw GX / Programming Stuff / Sample Code / Typography Samples / Dave’s Fab Samples ƒ / MenuHandler.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-20  |  3.6 KB  |  98 lines  |  [TEXT/KAHL]

  1. #ifndef __MENUHANDLER__
  2. #define __MENUHANDLER__
  3. /******************************************************************************\
  4. *
  5. * Apple Macintosh Developer Technical Support
  6. *
  7. * Main program file for the DavesFabSamples application
  8. *
  9. * Program: DavesFabSamples
  10. * File:    MenuHandler.h
  11. *
  12. * by:      Forrest Tanaka
  13. *
  14. * Copyright © 1988-1990 Apple Computer, Inc.
  15. * All rights reserved.
  16. *
  17. \******************************************************************************/
  18.  
  19.  
  20. /******************************************************************************\
  21. * Constants
  22. \******************************************************************************/
  23.  
  24. #define mApple 128 /* Menu ID and resource ID of Apple menu */
  25. #define iAbout   1 /* Menu item number of About SevenPaint item */
  26.  
  27. #define mFile 129 /* Menu ID and resource ID of File menu */
  28. #define iClose  1 /* Menu item number of Close item */
  29. #define iQuit   3 /* Menu item number of Quit item */
  30.  
  31. #define mSample 130 /* Menu ID and resource ID of Edit menu */
  32.  
  33. #define mLastMenu mSample /* Menu ID of the last menu in the menu bar */
  34.  
  35.  
  36. /******************************************************************************\
  37. * StartMenus - Do additional initialization of the menus
  38. *
  39. * This routine is called just after calling the Utilities sample code routine,
  40. * StandardMenuSetup.  This application needs to do just a little bit of
  41. * additional initialization for menus.  See MenuHandler.c for details.
  42. *
  43. * If there isn’t enough memory to load the menus, then memFullErr is returned.
  44. * If desired menu resources couldn’t be found, then resNotFound is returned.  If
  45. * any other error occurs, then dsSysErr is returned.
  46. \******************************************************************************/
  47.  
  48. OSErr StartMenus(void);
  49.  
  50.  
  51. /******************************************************************************\
  52. * DoMenuChoice - Dispatch to the appropriate routine for a menu choice
  53. *
  54. * When it’s determined that a menu item was chosen, this routine is called to
  55. * dispatch to the appropriate routine for the chosen menu item.  The menu item
  56. * and menu number returned by MenuSelect and MenuKey is passed in the menuChoice
  57. * parameter.
  58. \******************************************************************************/
  59.  
  60. void DoMenuChoice(
  61.     long menuChoice);
  62.  
  63.  
  64. /******************************************************************************\
  65. * FixMenus - Fix menus so that proper items are enabled and marked
  66. *
  67. * FixMenus is called to assure that menu items are disable, enabled, marked, and
  68. * unmarked appropriately.  It’s called at the end of every iteration of the main
  69. * event loop.
  70. \******************************************************************************/
  71.  
  72. void FixMenus(void);
  73.  
  74.  
  75. /******************************************************************************\
  76. * DisableAllMenus - Disable all menus except for the Help and Keyboard menus
  77. *
  78. * This routine disables all menus for a modal dialog box.  To restore all the
  79. * menu’s enable states back to the way they were, call RestoreAllMenus.
  80. * FixMenus should not be called between the calls to DisableAllMenus and
  81. * ReenableAllMenus.
  82. \******************************************************************************/
  83.  
  84. void DisableAllMenus(void);
  85.  
  86.  
  87. /******************************************************************************\
  88. * ReenableAllMenus - Reenable menus that were enabled at DisableAllMenus
  89. *
  90. * ReenableAllMenus reenables all menus that were disabled with DisableAllMenus.
  91. * This routine should be called after a modal dialog box goes away.
  92. \******************************************************************************/
  93.  
  94. void ReenableAllMenus(void);
  95.  
  96.  
  97. #endif
  98.